package com.ny.demo01;

import com.ny.demo.Employee;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class TestSet {
    public static void main(String[] args) {
        Employee employee1 = new Employee("1001","ouou",19);
        Employee employee2 = new Employee("1002","linlin",21);
        Set<Employee>set=new HashSet<>();
        set.add(employee1);
        set.add(employee2);
        for (Employee employee:set){
            System.out.println(employee);
        }
        Scanner scanner=new Scanner(System.in);
        String ename=scanner.next();
        for (Employee employee:set){
            if (ename.equals(employee.getName())){
            System.out.println(employee);
        }
    }
}
}
